<template>
  <div class="shop-info">
    <div class="shopTOP">
      <img :src="shopInfo.shopLogo" alt="" class="shopLogo"/>
      <span class="name">{{ shopInfo.name }}</span>
    </div>
    <div class="shop-middle">
        <div class="shop-middle-left">
            <table>
                <tr><td>{{(shopInfo.cSells/10000).toFixed(1)+'万'}}</td><td>{{shopInfo.cGoods}}</td></tr>
                <tr><td>总销量</td><td>全部宝贝</td></tr>
            </table>
            <!-- <div class="line"></div> -->
        </div>
        <div class="shop middle-right">
            <table v-for="(item,index) in shopInfo.score" :key='index'>
                <tr class="tr">
                    <td>{{shopInfo.score[index].name}}</td>
                    <td :class="{isred:shopInfo.score[index].isBetter}" class="green">{{shopInfo.score[index].score}}</td>
                    <td 
                    :class="{isred:shopInfo.score[index].isBetter}" 
                    class="green" 
                    id="message"
                    >{{item.isBetter ? '高':'低'}}</td>
                </tr>
                <!-- <tr><td>{{shopInfo.score[0].name}}</td>{{shopInfo.score[0].score}}<td></td></tr> -->
                <!-- <tr><td>{{shopInfo.score[1].name}}</td>{{shopInfo.score[1].score}}<td></td></tr>
                <tr><td>{{shopInfo.score[2].name}}</td>{{shopInfo.score[2].score}}<td></td></tr> -->
            </table></div>
    </div>
    <div class="shop-bottom">
            <div class="goshop">
                <a :href="shopInfo.shopUrl">进店逛逛</a>
            </div>
        </div>
  </div>
</template>

<script>
export default {
  name: "detailshopinfo",
  props: {
    shopInfo: {
      type: Object,
      default: {},
    },
  },
};
</script>

<style scoped>
.shop-info{
    padding: 25px 8px;
    border-bottom: 5px solid #f2f5f8;
    background-color: white;
}
.shopTOP{
    line-height: 45px;
    display: flex;
    align-items: center;
}
.shopLogo {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.name{
        margin-left: 10px;
}
.shop-middle{
    font-size: 15px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}
.shop-middle-left{
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: space-evenly;
    -ms-flex-pack: space-evenly;
    justify-content: space-evenly;
    color: #333;
    text-align: center;
    border-right: 1px solid rgba(0,0,0,.1);
}
.green{
    color: rgb(16, 133, 16);
}
.isred{
  color: red;
}
td{
  padding: 5px 10px;
}
.shop-bottom{
  justify-content: center;
  align-content: center;
  display: flex;
}
.shop-bottom .goshop{
    margin-top: 15px;
    width: 150px;
    height: 30px;
    /* display: inline-block; */
    font-size: 14px;
    background-color: #f2f5f8;
    text-align: center;
    line-height: 30px;
    border-radius: 10px;
  /* flex: 1; */
}
.shop-bottom .goshop a{
  font-size: 18px;
}
.shop-bottom .goshop a:hover{
  color: var(--color-high-text);
}
</style>